<?php $this->beginContent('application.views.layouts.main'); ?>
<div class="container">
    <div class="span-14 ui-widget-content ui-corner-all">
        <div id="content">
            <?php echo $content; ?>
        </div><!-- content -->
    </div>
    <div class="span-10 last printhide ui-corner-all">
        <div id="sidebar">
            <?php
            $this->beginWidget('zii.widgets.CPortlet', array(
                'title' => 'Related operation',
                'id' => 'ajaxPortlet',
            ));
            $this->widget('zii.widgets.CMenu', array(
                'items' => $this->rmenu,
                'htmlOptions' => array('class' => 'operations'),
            ));
            $this->endWidget();
            ?>
            <?php
            $this->beginWidget('zii.widgets.CPortlet', array(
                'title' => 'Operations',
            ));
            $this->widget('zii.widgets.CMenu', array(
                'items' => $this->menu,
                'htmlOptions' => array('class' => 'operations'),
            ));
            $this->endWidget();
            ?>
            <?php
                echo $this->sidebar;
            ?>
            <?php
            if (!Yii::app()->user->isGuest) {
                $this->beginWidget('zii.widgets.CPortlet', array(
                    'title' => 'Search',
                ));
            ?>

            <div class="row">
                <?php echo CHtml::label('Cargo search', 'searchField'); ?>
                <?php echo CHtml::textField('cargo_search'); ?>
                <?php echo CHtml::link('Search', '#', array('id' => 'cargo_search')); ?>
            </div>
            <?php $this->endWidget();
            } ?>
        </div><!-- sidebar -->
    </div>
</div>
<?php $this->endContent(); ?>
<?php
            $cs = Yii::app()->getClientScript();
            $searchURL = CHtml::normalizeUrl(array());

            $script = <<<EOD
$('input#cargo_search').keypress(function(event){
	if(event.keyCode == '13'){
		$('a#cargo_search').click();
	}
});
$('a#cargo_search').click(function(){
	window.location = 'http://spartanlogistics.biz/index.php/cargo/list/searchText/'+$('input#cargo_search').val();
});
EOD;
            $cs->registerScript("column2", $script, CClientScript::POS_END);
?>